This page last changed on Oct 20, 2006 by cholmes.

Now that you have updated the GeoServer application you can make use of your information at runtime. The GeoServer application is stored in the web context, and we have provided several convience methods to allow access.

HttpRequest based access:

HttpRequest httpRequest = (HttpRequest) servletRequest;
Requests.getWFS( httpRequest ).getServiceLevel()

GeoServer Framework (Request/Response/AbstractService)

GeoServer is broken down into various Servlets implemented by decendents of AbstractService. You can use the Request objects to access configuration information when handling a Response.

TransactionResponse example:

protected void execute(TransactionRequest transactionRequest){
  if( (Request.getWFS().getServiceLevel() | WFSDTO.DELETE ) == 0 ){
    throw ServiceException("Transaction Delete not supported");
  }
}

Java Server Pages

Java Server Pages allow direct access to objects stored in the web container.

Java Server Pages Example:

ServiceLevel:<bean:write name="Global.WFS" property="serviceLevel"/>

Struts (Action)

You may also reference GeoServer application information when implementing your own Java Server Pages as part of the GeoServer application.

GeoServerAction example:

Redirect execute( HttpServletRequest request, ){
  if ( (getWFS( request ).getServiceLevel() | WFSDTO.LOCKING ) == 0 ){
     throw ServiceException("Cannot Manage Locks as Locking has been disabled");
  }
  ...
}
Document generated by Confluence on Jan 16, 2008 23:26